package main

import "fmt"

func main() {
	defer func() {
		err := recover()
		fmt.Println("捕获到了：", err)
	}()

	var a []int
	a[0] = 10 // 索引越界 报错

	fmt.Println("这是main函数")
}
